<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
    <style>
      ul {
        padding: 0;
        list-style: none;
      }
      li {
        width: 200px;
        height: 25px;
        margin: 10px;
        background:orange;
      }
    </style>
  </head>
  <body>
    <div>
      <input type="text" placeholder="Search..." id="keyword" oninput="keywordSubmit()">
    </div>
    <div>
      <ul>
        <li>沢田纲吉(Z)</li>
        <li>狱寺隼人(E)</li>
        <li>山本武(E)</li>
        <li>蓝波(Z)</li>
        <li>笹川了平</li>
        <li>云雀恭弥</li>
        <li>库洛姆</li>
      </ul>
    </div>

    <script>
      function keywordSubmit() {
        const keyword = $.trim($("#keyword").val());
        $('li').each(function () {
          const text = $(this).text();
          if (keyword) {
            if (new RegExp(keyword.toLowerCase()).test(text.toLowerCase())) {
              $(this).show();
            } else {
              $(this).hide();
            }
          } else {
            $(this).show();
          }
        });
      }
    </script>
  </body>
</html>

